package sealte.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class UtilTools {
	
	public static boolean isIP(String ip_str){
		String reg = "((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)";
		Pattern pattern = Pattern.compile(reg);
		Matcher matcher = pattern.matcher(ip_str);
		return matcher.matches();
	}
	
	public static boolean isNum(String val) {
        return val == null || "".equals(val) ? false : val.matches("^[0-9]*$");
    }
}
